package com.tianji.remark.controller;


import com.tianji.remark.domain.dto.LikeRecordFormDTO;
import com.tianji.remark.service.ILikedRecordService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * <p>
 * 点赞记录表 前端控制器
 * </p>
 *
 * @author whx
 * @since 2025-01-03
 */
@RestController
@RequestMapping("/likes")
@Slf4j
@Api(tags = "点赞记录管理")
public class LikedRecordController {

    @Autowired
    private ILikedRecordService likedRecordService;

    @PostMapping
    @ApiOperation("点赞/取消点赞")
    public void like(@RequestBody LikeRecordFormDTO dto){
        likedRecordService.like(dto);
    }

    @GetMapping("/list")
    @ApiOperation("已点赞业务id集合")
    public List<Long> likedBizList(@RequestParam("bizIds") List<Long> bizIds){
        return likedRecordService.likedBizList(bizIds);
    }

}
